package com.huawei.appmarket.service.infoflow.card;

import android.content.Context;
import android.text.format.DateUtils;
import androidx.databinding.ViewDataBinding;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appmarket.service.infoflow.bean.InfoFlowCampaignCardBean;
import com.huawei.appmarket.service.infoflow.cards.card.BaseInfoFlowCard;
import o.ewm.n;
import o.ews;

public class InfoFlowCampaignCard extends BaseInfoFlowCard<ews> {
    public /* synthetic */ void ˊ(ViewDataBinding viewDataBinding) {
        ॱ((ews) viewDataBinding);
    }

    public InfoFlowCampaignCard(Context context) {
        super(context);
    }

    public void ॱ(ews o_ews) {
        super.ˊ(o_ews);
        ˏ(((ews) ʾ()).ˋ);
    }

    public void ˏ(CardBean cardBean) {
        super.ˏ(cardBean);
        if (cardBean instanceof InfoFlowCampaignCardBean) {
            InfoFlowCampaignCardBean infoFlowCampaignCardBean = (InfoFlowCampaignCardBean) cardBean;
            ((ews) ʾ()).ʻ.setText(infoFlowCampaignCardBean.v_());
            ((ews) ʾ()).ॱ.setText(infoFlowCampaignCardBean.ˊ());
            long ॱ = infoFlowCampaignCardBean.ॱ();
            long ʽ = infoFlowCampaignCardBean.ʽ();
            long ꓸ = infoFlowCampaignCardBean.ꓸ();
            if (ꓸ < ʽ) {
                if (ꓸ < ॱ) {
                    ((ews) ʾ()).ˏ.setText(this.ʼॱ.getResources().getString(n.ˎͺ, new Object[]{ˏ(ॱ)}));
                } else {
                    ((ews) ʾ()).ˏ.setText(this.ʼॱ.getResources().getString(n.ˋʽ, new Object[]{ˏ(ʽ)}));
                }
                ((ews) ʾ()).ʻ.setAlpha(1.0f);
                ((ews) ʾ()).ॱ.setAlpha(1.0f);
                ((ews) ʾ()).ˏ.setAlpha(1.0f);
            } else {
                ((ews) ʾ()).ˏ.setText(this.ʼॱ.getResources().getString(n.ˑॱ));
                ((ews) ʾ()).ʻ.setAlpha(0.3f);
                ((ews) ʾ()).ॱ.setAlpha(0.3f);
                ((ews) ʾ()).ˏ.setAlpha(0.3f);
            }
            ˋ(((ews) ʾ()).ॱॱ, infoFlowCampaignCardBean.ˋʻ());
            ᐝ(((ews) ʾ()).ॱ);
        }
    }

    private String ˏ(long j) {
        if (j == 0) {
            return "";
        }
        return DateUtils.formatDateTime(this.ʼॱ, j, 131092);
    }
}
